package com.ruoyi.algorithm.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonInclude;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;

import java.io.Serializable;

/**
 * @TableName table_struct
 */
@TableName(value = "table_struct")
@Setter
@Getter
@ToString
@EqualsAndHashCode
@NoArgsConstructor
@AllArgsConstructor
@ApiModel("表结构")
public class TableStruct implements Serializable {

    /**
     * 部分域构造类
     *
     * @param tableName 表名
     * @param fieldKey  字段名
     * @param fieldName 字段中文名
     */
    public TableStruct(String tableName, String fieldKey, String fieldName, boolean isExactMatching) {
        this.tableName = tableName;
        this.fieldKey = fieldKey;
        this.fieldName = fieldName;
        this.isExactMatching = isExactMatching;
    }

    /**
     * 主键
     */
    @TableId(value = "id")
    @ApiModelProperty("用户表结构关联id")
    private Long id;

    /**
     * 表名
     */
    @TableField(value = "table_name")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    private String tableName;

    /**
     * 字段名
     */
    @TableField(value = "field_key")
    @ApiModelProperty("字段名")
    private String fieldKey;

    /**
     * 字段中文名
     */
    @TableField(value = "field_name")
    @ApiModelProperty("字段中文名")
    private String fieldName;

    /**
     * 是否精确匹配
     */
    @TableField(value = "is_exact_matching")
    @ApiModelProperty("是否精确匹配")
    private Boolean isExactMatching;

    /**
     * 顺序
     */
    @TableField(exist = false)
    @ApiModelProperty("顺序")
    private Integer seq;

    /**
     * 是否显示(0不显示;1显示)
     */
    @TableField(exist = false)
    @ApiModelProperty("是否显示(0不显示;1显示)")
    private Boolean display;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

}
